
public class Exception {
public static void main(String[] args) {
	
	//Stack and heap
	//Stack-LIFO (last in First out)
			//pop, push, peek  
	//Queue - FIFO (first in first out)
	
	//Heap
		//Class class=  new Class();
	
	
	//Checked and Unchecked Exception
	// Checked: Compiler will complaining if u dont handle it
	// Unchecked: Compiler will not complain
	
	
	try{
	Exception exception = new Exception();
	exception.test1();
	}catch(RuntimeException ex)
	{
		System.out.println(ex.getMessage());
//		ex.printStackTrace();
		int a= 2/1;
				System.out.println(a);
	}
	
	
	System.out.println("mahi");
}

  public void test1()
  {
	  test2();
  }

  public void test2()
  {
	  test3();
  }

  private void test3() {
	int a = 1/0;
	
  }
}